Insert Text Action Icon

Insert Text

Declaration

<AMTEXTINSERT ACTION="text [options]" POSITION="number" INSERTTEXT="text" TARGETTEXT="text" RESULTVARIABLE="text [variable name]">

See Also

Create Variable Send Keystrokes

Description

Inserts characters into the specified text and place the result in a variable.

Practical Usage

Text manipulation. Used to insert new text into an already existing text value.

Parameters

General Tab

Text to insert into
Text, Required
MARKUP: TEXT="My Name is Joe"

Specifies target text to insert the new text into.  

Action to Take
Text [options], Optional (default: beginning and end)
MARKUP: ACTION="remove_beginning"

Specifies how the text is trimmed.

The available options are:

insert_beginning: The text is inserted at the beginning of the target text.

insert_end: The text is inserted at the endof the target text.

insert_position: The text is inserted at a specific position of the target text.

Position to insert text
Number, Required if ACTION is insert_position
MARKUP: POSITION="24"

Specifies the position in the text to perform the insert..

Characters to be inserted
Text, Required
MARKUP: INSERTTEXT="Hello"

Specifies the characters that should be inserted.

Populate Variable with Result
Text [variable name], Required
MARKUP: RESULTVARIABLE="varname"

Specifies the variable to receive the new value.

Notes

Using Variables
All variables must be created before they can be used. This is done using the
Create Variable <AMVARIABLE> action. Once created, variables can be set using the Set Variable <AMSET> action, or by certain actions that support populating variables. To get data out of the variables, in any action parameter, simply surround the variable name with percentage % signs (e.g. %varname%). Remember not to use percentage signs when specifying the name of a variable to populate, percentage signs are only needed to get data out.

Standard Error Handling Options
This action also includes the standard "Error Causes" and "On Error" failure handling options/tabs

More on Error Handling Options

Variables and Expressions
All text fields allow the use of expressions by surrounding the expression in percentage signs (example: %MYVARIABLE%, %Left('Text',2)%). To help construct these expressions, a popup expression builder is available in all these fields by pressing F2.
More on variables...

More on expressions...

More on the expression builder...

Example

<AMVARIABLE NAME="thevariable">Hello</AMVARIABLE>
<AMTEXTINSERT ACTION="insert_end" INSERTTEXT=" world" TARGETTEXT="%thevariable%" RESULTVARIABLE="thevariable">
<AMMESSAGEBOX>%thevariable%</AMMESSAGEBOX>